package com.atlin.project.service;

import com.atlin.project.model.domain.BiTeam;
import com.atlin.project.model.dto.biTeam.BiTeamQueryRequest;
import com.atlin.project.model.vo.BiTeamVO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;

/**
 * @author atlin
 * @description biTeam
 * @createDate date
 */
public interface BiTeamService extends IService<BiTeam> {

    void valid(BiTeam biTeam, boolean add);

    /**
     * 获取封装
     *
     * @param biTeam
     * @param request
     * @return
     */
    BiTeamVO getBiTeamVO(BiTeam biTeam, HttpServletRequest request);


    /**
     * 获取查询条件
     *
     * @param questionQueryRequest
     * @return
     */
    QueryWrapper<BiTeam> getQueryWrapper(BiTeamQueryRequest questionQueryRequest);

    /**
     * 分页获取封装
     *
     * @param questionPage
     * @param request
     * @return
     */
    Page<BiTeamVO> getBiTeamVOPage(Page<BiTeam> questionPage, HttpServletRequest request);

    boolean disbandTeam(long teamId);

    boolean leaveTeam(Long userId, Long teamId);

    BiTeam getTeamByChartId(long chartId);

    /**
     * 检查用户是否属于此团队
     *
     * @param userId
     * @param chartId
     * @return {@link boolean}
     */
    boolean checkUserBelongTeam(long userId, long chartId);
}
